package com.aloha.common.circle;

import com.aloha.common.aop.SysLog;
import com.aloha.po.User;
import com.aloha.springframework.beans.factory.annotation.Autowired;
import com.aloha.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author DaiZhiHeng
 * @date 2023/8/4 9:51
 */
@Component
public class SelfService {

    @Autowired
    private SelfService proxyService;

    private static final Map<String, User> USER_MAP = new HashMap<>();

    static {
        USER_MAP.put("1001", new User("1001", "dk1", "北京"));
        USER_MAP.put("1002", new User("1002", "dk2", "上海"));
        USER_MAP.put("1003", new User("1003", "dk3", "广州"));
        USER_MAP.put("1004", new User("1004", "dk4", "深圳"));
    }

    @SysLog
    public User getUser(String id) {
        return USER_MAP.get(id);
    }

    public User queryUser(String id) {
        return proxyService.getUser(id);
    }
}

